<?php

namespace app\model\system;

use crmeb\basic\BaseModel;
use crmeb\traits\ModelTrait;

/**
 * app页面路由
 * Class AppRouting
 * @package app\model\system
 */
class AppRouting extends BaseModel
{
    use ModelTrait;

    /**
     * 表明
     * @var string
     */
    protected $name = 'app_routing';
    protected $insert = ['add_time'];
    protected $autoWriteTimestamp = false;
    /**
     * 主键
     * @var string
     */
    protected $pk = 'id';

    protected function setAddTimeAttr($value)
    {
        return time();
    }

    public function pidRouting() {
        return $this->hasOne(AppRouting::class,'id', 'pid')->bind(['pid_name' => 'name']);
    }
}